package com.gopay.webtest.handler;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.gopay.webtest.util.BaseSign;
import com.gopay.webtest.util.ReflectUtil;

@Repository("trans2003Handler")
public class Trans2003Handler extends BaseSign   {

	@Override
	public String execute(Object obj, List<String> signFields) throws Exception {
		
		if(signFields == null || signFields.size()==0)
			throw new Exception("组装加签明文失败，加签域");
		StringBuffer sb = new StringBuffer();
		for(String singField : signFields){
			if("verficationCode".equals(singField))
			{
				sb.append("VerficationCode");
			}else{
				sb.append(singField);
			}
			
			sb.append("=[");
			
			sb.append(ReflectUtil.getFieldValue(obj, singField));
			
			sb.append("]");
		}
		return sb.toString();
	}

}
